<template>
	<view class="container">
				
		<uni-list>

			<uni-list-item title="个人认证" :showArrow='showArrow1'  @tap="onClick()" :rightText="rightText1"/>
			<uni-list-item title="商家认证" :showArrow='showArrow2'  @tap="onClickBiz()" :rightText="rightText2" />
		
		</uni-list>
		
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				rightText1: '去认证',
				rightText2: '去认证',
				showArrow1: true,
				showArrow2: true,
				personalStatus:0,
				bizStatus:0,
			};
		},
		onLoad() {
			this.getPersonalStatus()
			this.getBizStatus()
		},
		methods: {
			onClick() {
				// console.log('执行click事件', e.data)
				if(this.personalStatus === 0){
					uni.navigateTo({
					  	url:'/pages/user/setting/personal'
					})
				}
			},
			onClickBiz() {
				if(this.bizStatus === 0){
					uni.navigateTo({
						url:'/pages/business/register'
					})
				}
			},
			//是否个人认证
			getPersonalStatus(){
				uni.request({
					url: '/wanlshop/passport/getPassportStatus',
					type:'get',
					success: res => {
						if(res.data.status === 1){								
							this.rightText1 = '已认证'
							this.showArrow1 = false
							this.personalStatus = 1
						}
					}
				});				  
			},
			getBizStatus() {
				uni.request({
					url: '/wanlshop/passport/getPassportBizStatus',
					success: res => {
						if(res.data.status === 1){
							this.rightText2 = '已认证'
							this.showArrow2 = false
							this.bizStatus = 1
						}
					}
				});
			},
		
		}
	};
</script>

<style lang="scss" scoped>
	::v-deep .uni-icon-wrapper{
		padding: 0;
	}
</style>

